package org.test.controller.superadmin;

import org.easyspring.core.annotation.Autowired;
import org.easyspring.core.annotation.Controller;
import org.test.entity.bo.ShopCategory;
import org.test.entity.dto.Result;
import org.test.service.solo.ShopCategoryService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by Hy on 2021/7/24.
 */
@Controller
public class ShopCategoryOperationController {
    @Autowired
    private ShopCategoryService shopCategoryService;
    public Result<Boolean> add(HttpServletRequest req, HttpServletResponse resp) {
        //TODO 参数校验以及请求参数转化
        return shopCategoryService.add(new ShopCategory());
    }
    public Result<Boolean> del(HttpServletRequest req, HttpServletResponse resp) {
        //TODO 参数校验以及请求参数转化
        return shopCategoryService.del(1);
    }
    public Result<Boolean> update(HttpServletRequest req, HttpServletResponse resp) {
        //TODO 参数校验以及请求参数转化
        return shopCategoryService.update(new ShopCategory());
    }
    public Result<ShopCategory> queryById(HttpServletRequest req, HttpServletResponse resp) {
        //TODO 参数校验以及请求参数转化
        return shopCategoryService.queryById(1);
    }
    public Result<List<ShopCategory>> queryShopCategorys(HttpServletRequest req, HttpServletResponse resp) {
        //TODO 参数校验以及请求参数转化
        return shopCategoryService.queryShopCategorys(null,1,10);
    }
}
